﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		BlogRoll.Actions.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 //   File:            BlogRoll.Actions.cs
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion
 
using System.Text;

namespace Dexter.Domain.Model {
	public partial class BlogRoll {
		/// <summary>
		/// Generates the rel for <c>HTML</c> link. See also <seealso cref="http://microformats.org/"/>.
		/// </summary>
		/// <returns></returns>
		public virtual string GenerateRel ( ) {
			StringBuilder relUrl = new StringBuilder ( );

			if ( FriendType.HasValue && FriendType.Value != BlogRollFriendType.Nothing ) {
				relUrl.Append ( FriendType + " " );
			}

			if ( Met.HasValue && Met.Value ) {
				relUrl.Append ( "Met " );
			}

			if ( CoWorker.HasValue && CoWorker.Value ) {
				relUrl.Append ( "Co_worker " );
			}

			if ( Colleague.HasValue && Colleague.Value ) {
				relUrl.Append ( "Colleague " );
			}

			if ( GeographicalType.HasValue && GeographicalType.Value != BlogRollGeographicalType.Nothing ) {
				relUrl.Append ( GeographicalType + " " );
			}

			if ( FamilyType.HasValue && FamilyType.Value != BlogRollFamilyType.Nothing ) {
				relUrl.Append ( FamilyType + " " );
			}

			if ( Muse.HasValue && Muse.Value ) {
				relUrl.Append ( "Muse " );
			}

			if ( Crush.HasValue && Crush.Value ) {
				relUrl.Append ( "Crush " );
			}

			if ( Date.HasValue && Date.Value ) {
				relUrl.Append ( "Date " );
			}

			if ( Sweetheart.HasValue && Sweetheart.Value ) {
				relUrl.Append ( "Sweetheart " );
			}

			return relUrl.ToString ( ).TrimEnd ( );
		}
	}
}
